package com.study.www.demo.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 拦截器配置
 *
 * @author : Administrator.zhuyanpeng
 * @date : 2019/11/15 - 17:46
 */
@Configuration
public class DemoWebMvcInterceptorAdapter extends WebMvcConfigurationSupport {
    @Autowired
    Demo1Interceptor demoInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(demoInterceptor).addPathPatterns("/**");
        super.addInterceptors(registry);
    }

}
